package com.cloudfun.campusshare.repo;

import com.cloudfun.campusshare.entity.MessageEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Collection;
import java.util.List;

/**
 * Created by Huqin on 2019/12/28
 */
public interface MessageEntityRepo extends
        PagingAndSortingRepository<MessageEntity, String>,
        JpaSpecificationExecutor<MessageEntity> {

    MessageEntity findByRecipientAndIdAndEnabled(String recipientId, String id, Boolean enabled);

    List<MessageEntity> findByRecipientAndIdInAndEnabled(String recipientId, Collection<String> ids, Boolean enabled);

}
